package com.xiaozeng.collect.controller;

import com.xiaozeng.collect.service.CollectService;
import com.xiaozeng.param.CollectParam;
import com.xiaozeng.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xiaozeng
 * @Date: 2022 11
 * @Description:
 **/
@RestController
@RequestMapping("collect")
public class CollectController {
    @Autowired
    private CollectService collectService;

    /**
     * 添加收藏接口
     */
    @PostMapping("save")
    public Object save(@RequestBody CollectParam collectParam){

        return collectService.save(collectParam);
    }
    /**
     * 查看收藏夹
     */
    @PostMapping("list")
    public Result list(){

        return collectService.list();
    }
    /**
     * 移除收藏
     */
    @PostMapping("remove")
    public Object remove(@RequestBody CollectParam collectParam){

        return collectService.remove(collectParam);
    }

}
